package com.shtel.customerasset.mapper;

import com.shtel.customerasset.entity.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface QueryMapper {

    //查询用户设备号
    @Select("select mobilephone from custinfo where creditnum=#{creditnum}")
    public String queryshebeinum(@Param("creditnum") String creditnum);

    //查询在用套餐
    @Select("select taocanid from custyewuinfo where creditnum=#{creditnum}")
    public List<String> queryuseingtaocan(@Param("creditnum") String creditnum);

    //查询在用套餐起始时间
    @Select("select * from custyewuinfo where creditnum=#{creditnum} and taocanid=#{taocanid}")
    public Custyewuinfo queryuseingtaocanstartandendtime(@Param("creditnum") String creditnum,@Param("taocanid") String taocanid);

    //查询在用产品
    @Select("select chanpingid from custyewuinfo where creditnum=#{creditnum}")
    public List<String> queryuseingchanping(@Param("creditnum") String creditnum);

    //查询在用产品起始时间
    @Select("select * from custyewuinfo where creditnum=#{creditnum} and chanpingid=#{chanpingid}")
    public Custyewuinfo queryuseingchanpingstartandendtime(@Param("creditnum") String creditnum,@Param("chanpingid") String chanpingid);

    //new查询在途套餐
    @Select("select * from ongoingtaocan where creditnum=#{creditnum}")
    public List<OnGoingTaoCan> newqueryongoingtaocan(@Param("creditnum") String creditnum);

    //查询在途套餐
    @Select("select ongoingtaocanid from custyewuinfo where creditnum=#{creditnum}")
    public List<String> queryongoingtaocan(@Param("creditnum") String creditnum);

    //查询在途产品
    @Select("select ongoingchanpingid from custyewuinfo where creditnum=#{creditnum}")
    public List<String> queryongoingchanping(@Param("creditnum") String creditnum);

    //查询套餐信息
    @Select("select * from taocan where taocanid=#{taocanid}")
    public Taocan querytaocaninfo(@Param("taocanid") String taocanid);

    //查询产品信息
    @Select("select * from chanping where chanpingid=#{chanpingid}")
    public Chanping querychanpinginfo(@Param("chanpingid") String chanpingid);

    //查询终端信息
    @Select("select * from endduan where creditnum=#{creditnum}")
    public Endduan queryendduan(@Param("creditnum") String creditnum);

}
